package com.atguigu.gulimall.product.config;


import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import java.util.concurrent.*;

@SpringBootConfiguration
@EnableConfigurationProperties(ThreadPoolConfigProperties.class)
public class MyThreadConfig {

    @Bean
    public ExecutorService threadPoolExecutor(ThreadPoolConfigProperties threadPoolConfigProperties) {
        return Executors.newFixedThreadPool(10);
    }
}
